
#include <stdio.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <unistd.h>


typedef struct stu
{
	char name[32];
	int age;
}stu_t;

int main()
{
	int id=shmget(1234,0,0);
	if(id==-1)
	{
		perror("shmget");
		exit(1);
	}
	stu_t  *ps=(stu_t *)shmat(id,NULL,0);
	strcpy(ps->name,"hehe");
	ps->age=18;
}
